//
//  UserModel.swift
//  LeTu
//
//  Created by gy on 2023/11/24.
//

import Foundation

class UserModel: Mappable {
    
    /// 头像
    var avatar = ""
    /// 省份
    var province = ""
    /// 城市
    var city = ""
    /// 创建时间
    var createTime = ""
    /// 用户性别（0男，1女，2未知）
    var gender = 0
    /// 用户ID
    var id = 0
    /// 邀请码
    var inviteCode = ""
    /// 累计听了条数
    var listenNum = 0
    /// 成员类型（0: 未购买 1：单景点用户 2：月卡用户 3：季卡用户 4：年卡用户）
    var memberType = 0
    var memberName: String {
        switch memberType {
        case 1:
            return "月度会员"
        case 2:
            return "季度会员"
        case 3:
            return "年度会员"
        case 4:
            return "永久会员"
        default:
            return ""
        }
    }
    /// 到期时间
    var memberValidDate = ""
    /// 手机号
    var mobile = ""
    /// 用户昵称
    var nickname = ""
    /// 上级用户id
    var parentId = 0
    /// 邀请人的邀请码
    var parentInvitationCode = ""
    /// 上级手机号
    var parentMobile = ""
    /// 密码
    var password = ""
    /// 备注
    var remarks = ""
    /// 账号状态（0正常 1锁定）
    var status = 0
    /// 更新时间
    var updateTime = ""
    /// 微信id
    var openid = ""
    /// 微信昵称
    var wxName = ""
    
    init() {
        
    }
    
    required init?(map: ObjectMapper.Map) {
        
    }
    
    func mapping(map: ObjectMapper.Map) {
        
        avatar <- map["avatar"]
        province <- map["province"]
        city <- map["city"]
        createTime <- map["createTime"]
        gender <- map["gender"]
        id <- map["id"]
        inviteCode <- map["inviteCode"]
        listenNum <- map["listenNum"]
        memberType <- map["memberType"]
        memberValidDate <- map["memberValidDate"]
        mobile <- map["mobile"]
        nickname <- map["nickname"]
        parentId <- map["parentId"]
        parentInvitationCode <- map["parentInvitationCode"]
        parentMobile <- map["parentMobile"]
        password <- map["password"]
        remarks <- map["remarks"]
        status <- map["status"]
        updateTime <- map["updateTime"]
        openid <- map["openid"]
        wxName <- map["wxName"]
        
    }
    
}





